﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Nage.Algorithms;
using Nage.Algorithms.Solution;
using Nage.Algorithms.Population;
using Nage.Algorithms.Evolution;
using Nage.Algorithms.Stop;
using Nage.Examples.Rastrigin.Evolution;
using Nage.Examples.Rastrigin.Solution;
using Nage.Examples.Rastrigin.Population;

namespace Nage.Examples.Rastrigin
{
    public class RastriginProblem : GeneticAlgorithm<Coordinates>
    {
        public RastriginProblem(int populationSize, double mutationRate, double delta, double crossoverRate, int stepCount)
        {
            PopulationFactory = new CoordinatesPopulationFactory(populationSize);
            SolutionEvaluator = new RastriginFunctionEvaluator();
            StopCondition = new FixedStepsStopCondition(stepCount);
            Evolution = new CoordinatesEvolution(mutationRate, delta, crossoverRate);
        }
    }
}
